﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using Broker.Service.EntityModel;

namespace Broker.Service.Model
{
    public enum VisitTypeEnum { Connected = 1, DownLoadData = 2, DownLoadScore = 3 };
    public class VisitRecordUtil
    {
        public static void AddRecord(string name, VisitTypeEnum visitType, DateTime visitTime, string ipAddress, broker30Entities entity)
        {
            try
            {
                string sql="insert into sale_visitRecord (clientid,visittype,visittime,ipaddress) select c.Id,{0},{1},{2}  from sale_client as c where c.Name={3}";

                entity.ExecuteStoreCommand(sql, new object[] { visitType, visitTime, ipAddress, name });

            }
            catch(Exception ex)
            {
                throw ex;
            }
        }
    }
}